package com.haiyi.software.app;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class ActivityAboutme extends Activity implements OnClickListener {

	private Button btn_feedback;
	private Button btn_score;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO 自动生成的方法存根
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_about);

		initCom();
	}

	private void initCom() {

		TextView textView_currentversion = (TextView) this
				.findViewById(R.id.textView_currentversion);

		textView_currentversion.setText(MainApplication.VERSION);

		btn_feedback = (Button) this.findViewById(R.id.btn_feedback);
		btn_score = (Button) this.findViewById(R.id.btn_score);

		btn_feedback.setOnClickListener(this);

		btn_score.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {

		switch (v.getId()) {
		case R.id.btn_feedback:

			Intent intentfeedback = new Intent();

			intentfeedback.setClass(ActivityAboutme.this,
					ActivityFeedback.class);

			startActivity(intentfeedback);

			break;
		case R.id.btn_score:
			Uri uri = Uri.parse("market://details?id=" + getPackageName());
			Intent intent = new Intent(Intent.ACTION_VIEW, uri);
			intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			startActivity(intent);
			break;
		}
	}
}
